package edu.qd.learn.newchapter.chapter02.exam02;

/**
 * 汉英
 *
 * @author 布衣
 */
public class ChineseWithEnglishDictionary implements Dictionary {

    //拿到通用词条
    WordReportTable commWord =  initWordReportTable();

    @Override
    public String search(String word) {
        WordReportTable.ReportNode head = commWord.getHead();
        while(head != null){
            if (head.reports.getCnName().equals(word)) {
                return head.reports.getEnName();
            }
            head = head.next;
        }
        return "对不起，没有找到对应的词条";
    }


}
